<template>
  <div class="content">
    <addmemberlist :total="this.sum" :data="this.userList.slice((currentPage-1)*pagesize,currentPage*pagesize)" :GroupId="this.GroupId"></addmemberlist>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        userList: [],
        permission: this.$store.state.permission,
        AdminId:this.$store.state.userId,
        GroupId:this.$route.query.GroupId,
        currentPage: 1, //初始页
        pagesize: 6,
        sum:'',
      }
    },
    props: {
      transport_data: String
    },
    created() {
      this.loadUsers(1,6);
    },
    methods: {
      loadUsers(page,size) {
        this.$axios.get('/api/Group/ShowAllUser', {
            params: {
              AdminId: this.AdminId,
              page: page,
              size: size,
            },
          })
          .then(res => {
            this.userList = res.data.data.list;
            this.sum=res.data.data.total;
          })
          .catch(err => {
            console.log(err)
          })
      },
      set_userlist(userList,sum) {
        this.userList = userList;
        this.sum=sum;
      }
    },
  };
</script>

<style>
</style>
